/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * VentanaPrincipal.java
 *
 * Created on 20-may-2011, 19:39:03
 */

package GUI;

import Interfaz.Interfaz;
import javax.swing.ImageIcon;

/**
 *
 * @author Administrador
 */
public class VentanaPrincipal extends javax.swing.JFrame {

    /** Creates new form VentanaPrincipal */
	private Interfaz laInterfaz;
    public VentanaPrincipal(Interfaz laInterfaz) {
		this.laInterfaz=laInterfaz;
        initComponents();
		this.setLocationRelativeTo(null); // Cambiar icono de java en ventana
        this.setIconImage(new ImageIcon("src/imagenes/marketplus2.png").getImage());
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel4 = new javax.swing.JLabel();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jTUsuario = new javax.swing.JTextField();
        jBAceptar = new javax.swing.JButton();
        jBCancelar = new javax.swing.JButton();
        jPasswordField1 = new javax.swing.JPasswordField();
        jBCancelar1 = new javax.swing.JButton();
        jLabel5 = new javax.swing.JLabel();

        jLabel4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/registro-online.jpg"))); // NOI18N

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setMinimumSize(new java.awt.Dimension(300, 100));
        setResizable(false);
        getContentPane().setLayout(null);

        jLabel1.setFont(new java.awt.Font("Tahoma", 1, 18));
        jLabel1.setText("Inicio de Sesion");
        getContentPane().add(jLabel1);
        jLabel1.setBounds(10, 0, 160, 22);

        jLabel2.setFont(new java.awt.Font("Tahoma", 1, 12));
        jLabel2.setText("Usuario:");
        getContentPane().add(jLabel2);
        jLabel2.setBounds(70, 50, 60, 20);

        jLabel3.setFont(new java.awt.Font("Tahoma", 1, 12));
        jLabel3.setText("Clave:");
        getContentPane().add(jLabel3);
        jLabel3.setBounds(70, 80, 70, 20);

        jTUsuario.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTUsuarioActionPerformed(evt);
            }
        });
        getContentPane().add(jTUsuario);
        jTUsuario.setBounds(140, 50, 150, 20);

        jBAceptar.setText("Aceptar");
        jBAceptar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBAceptarActionPerformed(evt);
            }
        });
        getContentPane().add(jBAceptar);
        jBAceptar.setBounds(70, 130, 100, 23);

        jBCancelar.setText("Ir a Pag Principal");
        jBCancelar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBCancelarActionPerformed(evt);
            }
        });
        getContentPane().add(jBCancelar);
        jBCancelar.setBounds(100, 160, 150, 23);
        getContentPane().add(jPasswordField1);
        jPasswordField1.setBounds(140, 80, 150, 20);

        jBCancelar1.setText("Regristrarse");
        jBCancelar1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBCancelar1ActionPerformed(evt);
            }
        });
        getContentPane().add(jBCancelar1);
        jBCancelar1.setBounds(180, 130, 110, 23);

        jLabel5.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/registro-online.jpg"))); // NOI18N
        jLabel5.setText("jLabel5");
        getContentPane().add(jLabel5);
        jLabel5.setBounds(-6, 0, 320, 210);

        java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
        setBounds((screenSize.width-324)/2, (screenSize.height-237)/2, 324, 237);
    }// </editor-fold>//GEN-END:initComponents

	private void jTUsuarioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTUsuarioActionPerformed
		// TODO add your handling code here:
	}//GEN-LAST:event_jTUsuarioActionPerformed

	private void jBCancelarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBCancelarActionPerformed
		// TODO add your handling code here:
		Principal iraPrincipal=new Principal(laInterfaz);
		iraPrincipal.setVisible(true);
		this.dispose();
	}//GEN-LAST:event_jBCancelarActionPerformed

	private void jBAceptarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBAceptarActionPerformed
		// TODO add your handling code here:
		CompraOnline irCompraOnline = new CompraOnline(laInterfaz);
		irCompraOnline.setVisible(true);
		this.dispose();
		
	}//GEN-LAST:event_jBAceptarActionPerformed

	private void jBCancelar1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBCancelar1ActionPerformed
		// TODO add your handling code here:
		RegistroCliente irRegistroCliente=new RegistroCliente(laInterfaz);
		irRegistroCliente.setVisible(true);
		this.dispose();
		
	}//GEN-LAST:event_jBCancelar1ActionPerformed

    /**
    * @param args the command line arguments
    */
   

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jBAceptar;
    private javax.swing.JButton jBCancelar;
    private javax.swing.JButton jBCancelar1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JPasswordField jPasswordField1;
    private javax.swing.JTextField jTUsuario;
    // End of variables declaration//GEN-END:variables

}
